package liu.mp3player;

import android.app.TabActivity;
import android.content.*;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class MainActivity extends TabActivity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        gettabHost(Mp3ListActivity.class, "Remote", android.R.drawable.stat_sys_download);
        gettabHost(LocalMp3ListActivity.class, "Local", android.R.drawable.stat_sys_upload);       		
	}
	
	private void gettabHost(Class intentClass,String SpecName,int SpecIcon){
		TabHost tabHost=getTabHost();
		TabHost.TabSpec Spec=tabHost.newTabSpec(SpecName);
		Intent intent=new Intent();
		intent.setClass(this,intentClass);
		Resources res=getResources();
		Spec.setIndicator(SpecName, res.getDrawable(SpecIcon));
		Spec.setContent(intent);
		tabHost.addTab(Spec);
	}
	

}
